package utils;

import java.util.HashMap;
import java.util.Map;

import android.graphics.Bitmap;

public class CashData {
	private Map <String, Object> _cashMap;
	private static CashData _cashInstance;
	public final static String USER_INFO = "user_info";
	
	private CashData() {
		_cashMap = new HashMap<String, Object>();
	}
	
	public static CashData getInstance() {
		if(_cashInstance==null)
			_cashInstance = new CashData();
		
		return _cashInstance;
	}
	
	public void setUserInfo(UserInfo info) {
		_cashMap.put(USER_INFO, info);
	}
	
	public UserInfo getUserInfo() {
		return (UserInfo)_cashMap.get(USER_INFO);
	}
	
	public Object get(String key) {
		return _cashMap.get(key);
	}
	
	public void put(String key, Object value) {
		_cashMap.put(key, value);
	}
	
	public boolean containsKey(String key) {
		return _cashMap.containsKey(key);
	}
	
	public void clearCash() {
		_cashMap.clear();
	}
}
